package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.LvyouFeiyiDao;
import com.bootdo.lvyou.domain.LvyouFeiyi;
import com.bootdo.lvyou.service.LvyouFeiyiService;



@Service
public class LvyouFeiyiServiceImpl implements LvyouFeiyiService {
	@Autowired
	private LvyouFeiyiDao lvyouFeiyiDao;
	
	@Override
	public LvyouFeiyi get(Long id){
		return lvyouFeiyiDao.get(id);
	}
	
	@Override
	public List<LvyouFeiyi> list(Map<String, Object> map){
		return lvyouFeiyiDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lvyouFeiyiDao.count(map);
	}
	
	@Override
	public int save(LvyouFeiyi lvyouFeiyi){
	
		if(lvyouFeiyi.getId() != null) {
			return lvyouFeiyiDao.update(lvyouFeiyi);
		}else {
			return lvyouFeiyiDao.save(lvyouFeiyi);
		}		
	
		
	}
	
	@Override
	public int update(LvyouFeiyi lvyouFeiyi){
		return lvyouFeiyiDao.update(lvyouFeiyi);
	}
	
	@Override
	public int remove(Long id){
		return lvyouFeiyiDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouFeiyiDao.batchRemove(ids);
	}

	@Override
	public List<LvyouFeiyi> getByCityId(Long cityId) {
		return lvyouFeiyiDao.getByCityId(cityId);
	}

	@Override
	public List<LvyouFeiyi> getByCityIdLatAndLng(Map<String, Object> map) {
		return lvyouFeiyiDao.getByCityIdLatAndLng(map);
	}

}
